<template>
	<view class="container">
		<view class="none" v-if="result.length==0" v-on:click="form_collection">还没有收款方式，点此此处添加</view>
		<block v-else>
			<view class="unit unipay">
				<view class="unit_con">
					<view class="bank">开户姓名：</view>
					<view class="account">{{result[0].account_name}}</view>
				</view>
				<view class="unit_con">
					<view class="bank">身份证号码：</view>
					<view class="account">*** **** **** {{result[0].id_card_no.substr(-4)}}</view>
				</view>
				<view class="unit_con">
					<view class="bank">预留手机号码：</view>
					<view class="account">{{result[0].bank_cell_phone}}</view>
				</view>
				<view class="unit_con">
					<view class="bank">开户行：</view>
					<view class="account">*** **** **** {{result[0].account_no.substr(-4)}}</view>
				</view>
			</view>
			<view class="status">
				<view class="status_key">审核状态:</view>
				<view class="status_value_" v-if="result[0].create_account_status==1">{{result[0].err_msg}}</view>
				<view class="status_value" v-else>{{result[0].err_msg}}</view>
			</view>
			<image mode="widthFix" :src="url+'/'+result[0].settlement_person_id_card_front_photo"></image>
			<image mode="widthFix" :src="url+'/'+result[0].settlement_person_id_card_back_photo"></image>
			<image mode="widthFix" :src="url+'/'+result[0].bank_card_photo"></image>
		</block>
		<view class="lh"></view>
		<view class="foot" v-if="result.length==0">
			<view class="modify_button" id="0" v-on:click="form_collection">添加转账信息</view>
		</view>
		<view class="foot" v-else>
			<view class="modify_button_" :id="result[0].bank_info_id" v-on:click="modify_submit">完善</view>
			<view class="delete_button" :id="result[0].bank_info_id" v-on:click="next" v-if="result[0].create_account_status==1">申请</view>
			<view class="delete_button" :id="result[0].bank_info_id" v-else>---</view>
		</view>
	</view>
</template>
<style>
	/*********************/
	page{background: #F4F4F4;}
	.container{background: #F4F4F4;}
	.none{width:100%;background: #FFFFFF;line-height: 100upx;font-size: 28upx;text-align: center;color: #666666;}
	.operate{width:94%;padding:0 3%;display: flex;justify-content:space-between;align-items: center;height: 70upx;}
	.button{font-size: 28upx;color: #333333;}
	.unit{width:96%;margin:10upx 2%;border-radius: 10upx;padding: 10upx 0;}
	.unit image{width:40upx;}
	.wechat{background-image: linear-gradient(#5bc551,#7ac573);}
	.alipay{background-image: linear-gradient(#07a0f8,#33b0f8);}
	.unipay{background-image: linear-gradient(#dbaf6c,#f1c171);}
	image{width:80%;margin:20upx 10%;}
	.unit_con{width:80%;margin:10upx 10%;display: flex;justify-content: space-between;align-items: center;height: 60upx;}
	.bank{color: #FFFFFF;font-size: 28upx;line-height: 50upx;}
	.account{color: #FFFFFF;font-size: 28upx;line-height: 50upx;}
	.foot{width:96%;margin:20upx 2%;height: 100upx;position: fixed;bottom: 0;left:0;display: flex;justify-content: space-between;align-items: center;}
	.modify_button{width:100%;height: 80upx;line-height: 80upx;border-radius: 40upx;text-align: center;color: #FFFFFF;background-image: linear-gradient(#5bc551,#7ac573);}
	.modify_button_{width:48%;height: 80upx;line-height: 80upx;border-radius: 40upx;text-align: center;color: #FFFFFF;background-image: linear-gradient(#282828,#000000);}
	.delete_button{width:48%;height: 80upx;line-height: 80upx;border-radius: 40upx;text-align: center;color: #FFFFFF;background-image: linear-gradient(#dbaf6c,#f1c171);}
	.status{width:76%;margin:10upx 12%;padding: 10upx 0;display: flex;justify-content: space-between;align-items: center;line-height: 70upx;}
	.status_key{font-size: 28upx;width:30%;}
	.status_value{font-size: 28upx;width:68%;color:#dbaf6c ;}
	.status_value_{font-size: 28upx;width:68%;color:#5bc551 ;}
	.lh{width:100%;height: 110upx;}
</style>
<script>
	export default {
		data() {
			return {
				current: 0,
				result:[],
				member:{},
				status:1,
				width:0,
				height:'',
				display:0,
				id:0,
				url: getApp().globalData.url,
				static:getApp().globalData.static
			}
		},
		onLoad() {
			var res = uni.getSystemInfoSync();
			this.width  = res.windowWidth;
			this.height = res.windowHeight+"px";
		},
		onShow() {
			this.initialize();
		},
		methods: {
			next:function(e)
			{
				var id = e.currentTarget.id;
				uni.navigateTo({
					url:"form_withdrawal?type="+this.type+"&id="+id
				})
			},
			modify_submit:function(e)
			{
				var id = e.currentTarget.id;
				uni.navigateTo({
					url:"form_collection?id="+id
				})
			},
			form_manage:function(e)
			{
				this.id = parseInt(e.detail.value);
			},
			manage:function()
			{
				if(this.display==0)
				{
					this.display = 1;
				}
				else
				{
					this.display = 0;
				}
			},
			form_collection:function()
			{
				uni.navigateTo({
					url:"form_collection?id=0"
				})
			},
			operation:function(e)
			{
				var id = e.currentTarget.id;
				this.current = parseInt(id);
				this.id = parseInt(id);
				// this.initialize(this.id);
			},
			withdrawal:function()
			{
				uni.navigateTo({
					url:"withdrawal"
				})
			},
			initialize:function()
			{
				var member_id = uni.getStorageSync("member_id");
				// var member_id = 169097;
				var that = this;
				uni.request({
					url: this.url+'/wechat_get_member_collection', 
					method:"POST",
					data: {member_id:member_id,id:0},
					header: {'Content-Type': 'application/x-www-form-urlencoded'},
					success: (res) => {
						console.log(res.data);
						if(res.data.status==1)
						{
							that.result = res.data.result;
						}
					}
				});
			}
		}
	}
</script>


